{extend name="./index/index" /}

{block name="list"}
<ul id="main-menu" class="main-menu">

<li>
    <a href="web/index">
        <i class="linecons-cog"></i>
        <span class="title">网站数据</span>
    </a>
</li><!--END 网站数据-->

<li>
    <a href="">
        <i class="fa-group"></i>
        <span class="title">用户管理</span>
    </a>
    <ul>
        <li>
            <a href="/admin/index">
                <span class="title">用户列表</span>
            </a>
        </li>
        <li>
            <a href="/admin/index/user">
                <span class="title">管理员列表</span>
            </a>
        </li>
        <li>
            <a href="/admin/index/create">
                <span class="title" >添加管理员</span>
            </a>
        </li>
    </ul>
</li><!--END 用户管理-->

<li class="opened active">
    <a href="">
        <i class="linecons-desktop"></i>
        <span class="title">影片管理</span>
    </a>
    <ul>
        <li class="active">
            <a href="">
                <span class="title">影片列表</span>
            </a>
        </li>
        <li>
            <a href="/admin/film/create">
                <span class="title">上新电影</span>
            </a>
        </li>
        
    </ul>
</li><!--END 影片管理-->

<li>
    <a href="forms-native.html">
        <i class="linecons-params"></i>
        <span class="title">影院管理</span>
    </a>
    <ul>
        <li>
            <a href="forms-file-upload.html">
                <span class="title">全部影院</span>
            </a>
        </li>
        <li>
            <a href="forms-修改ors.html">
                <span class="title">上新影院</span>
            </a>
        </li>
        <li>
            <a href="forms-sliders.html">
                <span class="title">待续</span>
            </a>
        </li>
    </ul>
</li><!--END 影院-->

<li>
    <a href="extra-gallery.html">
        <i class="linecons-beaker"></i>
        <span class="title">订单管理</span>
    </a>
    <ul>
        <li>
            <a href="extra-icons-fontawesome.html">
                <span class="title">Icons</span>
                <span class="label label-warning pull-right">4</span>
            </a>
        </li>
    </li>
    </ul>
</li><!--END 订单-->

<li>
    <a href="ui-widgets.html">
        <i class="linecons-star"></i>
        <span class="title">暂定</span>
    </a>
    <ul>
        <li>
            <a href="extra-icons-fontawesome.html">
                <span class="title">暂定</span>
                <span class="label label-warning pull-right">4</span>
            </a>
        </li>
    </li>
    </ul>
</li>
<li>
    <a href="charts-main.html">
        <i class="linecons-globe"></i>
        <span class="title">Charts</span>
    </a>
    <ul>
        <li>
            <a href="charts-main.html">
                <span class="title">Chart Variants</span>
            </a>
        </li>
        <li>
            <a href="charts-range.html">
                <span class="title">Range Selector</span>
            </a>
        </li>
        <li>
            <a href="charts-sparklines.html">
                <span class="title">Sparklines</span>
            </a>
        </li>
        <li>
            <a href="charts-map.html">
                <span class="title">Map Charts</span>
            </a>
        </li>
        <li>
            <a href="charts-gauges.html">
                <span class="title">Circular Gauges</span>
            </a>
        </li>
        <li>
            <a href="charts-bar-gauges.html">
                <span class="title">Bar Gauges</span>
            </a>
        </li>
    </ul>
</li>
<li>
    <a href="#">
        <i class="linecons-cloud"></i>
        <span class="title">Menu Levels</span>
    </a>
    <ul>
        <li>
            <a href="#">
                <i class="entypo-flow-line"></i>
                <span class="title">Menu Level 1.1</span>
            </a>
            <ul>
                <li>
                    <a href="#">
                        <i class="entypo-flow-parallel"></i>
                        <span class="title">Menu Level 2.1</span>
                    </a>
                </li>
                <li>
                    <a href="#">
                        <i class="entypo-flow-parallel"></i>
                        <span class="title">Menu Level 2.2</span>
                    </a>
                    <ul>
                        <li>
                            <a href="#">
                                <i class="entypo-flow-cascade"></i>
                                <span class="title">Menu Level 3.1</span>
                            </a>
                        </li>
                        <li>
                            <a href="#">
                                <i class="entypo-flow-cascade"></i>
                                <span class="title">Menu Level 3.2</span>
                            </a>
                            <ul>
                                <li>
                                    <a href="#">
                                        <i class="entypo-flow-branch"></i>
                                        <span class="title">Menu Level 4.1</span>
                                    </a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li>
                    <a href="#">
                        <i class="entypo-flow-parallel"></i>
                        <span class="title">Menu Level 2.3</span>
                    </a>
                </li>
            </ul>
        </li>
        <li>
            <a href="#">
                <i class="entypo-flow-line"></i>
                <span class="title">Menu Level 1.2</span>
            </a>
        </li>
        <li>
            <a href="#">
                <i class="entypo-flow-line"></i>
                <span class="title">Menu Level 1.3</span>
            </a>
        </li>
    </ul>
</li>
</ul>
{/block}




{block name="table"}
<div class="page-title">
    <div class="title-env">
        <h1 class="title">{$title}</h1>
        <p class="description">有意见就跟我提，不要对上帝的数据发脾气。</p>
    </div>
    
        <div class="breadcrumb-env">
        
                    <ol class="breadcrumb bc-1">
                        <li>
                <a href="/admin"><i class="fa-home"></i>Home</a>
            </li>
                    <li>
            
                            <a href="./index.php">影片管理</a>
                    </li>
                <li class="active">
            
                            <strong>{$title}</strong>
                    </li>
                    </ol>
                    
    </div>
        
</div>

<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">{$title}</h3>
    </div>
    <div class="panel-body">
        
        
        
    <table cellspacing="0" class="table table-small-font table-bordered table-striped table-hover text-center">
        <thead>
            <tr>
                <th class="col-md-1">影片ID</th>
                <th>影片名称</th>
                <th>影片时长</th>
                <th>上映时间</th>
                <th>语言</th>
                <th>国家</th>
                <th>评分</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
        {volist name="data" id="val"}
                <tr>
                    <td>{$val['id']}</td>
                    <td>{$val['filmname']}</td>
                    <td>{$val['time']}</td>
                    <td>{$val['year']}</td>
                    <td>
                    {eq name="$val['tongue']" value="0"}中文{/eq}
                    {eq name="$val['tongue']" value="1"}英文{/eq}
                    {eq name="$val['tongue']" value="2"}日语{/eq}
                    {eq name="$val['tongue']" value="3"}韩语{/eq}
                    </td>
                    <td>
                    {eq name="$val['state']" value="0"}中国{/eq}
                    {eq name="$val['state']" value="1"}美国{/eq}
                    {eq name="$val['state']" value="2"}日本{/eq}
                    {eq name="$val['state']" value="3"}韩国{/eq}
                    {eq name="$val['state']" value="4"}印度{/eq}
                    </td>
                    <td>{$val['grade']}</td>
                    <td class="col-md-2">
                            <a data-id="{$val['id']}" class="btn btn-info btn-sm xxxxx" data-toggle="modal" data-target="#myModal" style="border-radius:10px;">详情</a>
                            <a data-id="{$val['id']}" class="btn btn-danger btn-sm dedede" style="border-radius:10px;">删除</a>
                    </td>
                </tr>
        {/volist}
        <script>
            $(function(){
                $('.xxxxx').click(function(){
                    // console.log($(this).attr('data-id'));
                    var id = $(this).attr('data-id');
                    $.ajax({
                        type : 'get',
                        url : "{:url('film/info')}",
                        data : "id="+id,
                        success : function(data){
                            $('#person').html(data[0]['person']);
                            $('#filmname').html(data[0]['filmname']);
                            $('#image').attr('src', '/static/image/'+data[0]['filmimg']);
                            $('#year').html(data[0]['year']);
                            $('#info').html(data[0]['info']);
                            $('#count').html(data[0]['count']);
                            $('#count').html(data[0]['count']);
                        }
                    })

                     $.ajax({
                        type : 'get',
                        url : "{:url('film/infotwo')}",
                        data : "id="+id,
                        success : function(data){
                            $('#details').html(data[0]['details']);
                        }
                    })
                });
            })
        </script>
        </tbody>
    </table>
        共{:count($data)}条数据
    </div>
</div>
{/block}

{block name="modal"}
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">影片详情</h4>
      </div>
      <div class="modal-body">
      <div class="row">
          <div class="col-md-6">
              <img id="image" src="" width="210" height="300">
          </div>
          <div class="col-md-6">
              <!--影片名称-->
              <h2 id="filmname"></h2>
              <p id="info"></p>
              <h4>上映时间</h4>
              <p id="year"></p>
              <h4>播放次数</h4>
              <p id="count"></p>
              <h4>导演 / 演员</h4>
              <p id="person"></p>
          </div>
      </div>
      <div class="row">
          <div class="col-md-12">
              <h4>影片介绍</h4>
              <p id="details"></p>
          </div>
      </div>
      </div>
      <div class="modal-footer">
      <a class="btn btn-primary" style="border-radius:10px;">编辑</a>
        <button type="button" class="btn btn-info" data-dismiss="modal" style="border-radius:10px;">离开</button>
      </div>
    </div>
  </div>
</div>
{/block}

